<template>
  <div>
    <el-form-item label="上传图片">
      <sy-upload
        :list="list"
        :api="$apis.upload.uploadFile"
        :data="{ busSubType: 1015 }"
        :show-file-list="false"
        :max-size="100 * 1024 * 1024"
        tips=""
        :upload-bt="'bt'"
        @httpRes="uploadRes"
      />
    </el-form-item>
    <el-form-item label="图片宽度">
      <el-input v-model="data.params.width" type="number" placeholder="图片宽度(px)" />
    </el-form-item>
    <el-form-item label="图片高度">
      <el-input v-model="data.params.height" type="number" placeholder="图片高度(px)" />
    </el-form-item>
  </div>
</template>
<script>
  // 图片 组件配置
  import SyUpload from '@/components/SyUpload'
  export default {
    name: 'ConfigCusimg',
    components: { SyUpload },
    props: {
      data: {
        type: Object,
        default() {
          return {}
        }
      }
    },
    data() {
      return {
        list: []
      }
    },
    methods: {
      uploadRes(data) {
        if (!data.fileId) return
        this.data.params.fileId = data.fileId
        this.data.params.fileName = data.fileName
        console.log(data, this.data.file, '这是data')
      }
    },
  }
</script>
<style lang="less" rel="stylesheet/less" scoped></style>
